{layout name="main" /}
<section class="layui-larry-box">
    <div class="larry-personal">
        <header class="larry-personal-tit">
            <span>修改密码</span>
        </header><!-- /header -->
        <div class="larry-personal-body clearfix changepwd">
            <form id="password_form" class="layui-form col-lg-4" method="post" action="{:url('user/index/password')}">
                <div class="layui-form-item">
                    <label for="username" class="layui-form-label">用户名</label>
                    <div class="layui-input-block">
                        <input id="username" name="username"  autocomplete="off"  class="layui-input layui-disabled" value="admin" disabled >
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">旧密码</label>
                    <div class="layui-input-block">
                        <input type="password" name="old_password"  autocomplete="off"  class="layui-input" value="" placeholder="请输入旧密码">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">新密码</label>
                    <div class="layui-input-block">
                        <input type="password" name="password"  autocomplete="off"  class="layui-input" value="" placeholder="请输入新密码">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">确认密码</label>
                    <div class="layui-input-block">
                        <input type="password" name="password_confirm"  autocomplete="off"  class="layui-input" value="" placeholder="请输入确认新密码">
                    </div>
                </div>
                <div class="layui-form-item change-submit">
                    <div class="layui-input-block">
                        <button id="submit" class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</section>
<script type="text/javascript">
    layui.use(['form','upload'],function(){
        var form = layui.form;
        form.on('submit(*)',function (data) {
            console.log("submit");
            console.log(data);
            return false;
        });
    });
    $("#submit").click(function () {
        submitForm("#password_form",function (res) {
            if(res.code){
                layer.msg(res.msg,{icon:1,time:1500},function () {
                    parent.window.location.href = res.url;
                });
            }else{
                layer.msg(res.msg,{icon:2,time:1500});
            }
        });
        return false;
    });
</script>